import java.util.Scanner;

public class demo02 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] arr=new int[n];
        for (int i = 0; i < n; i++) {
            arr[i]=sc.nextInt();
        }
        while (sc.hasNext()){
            int A=0;
            int B=0;
            int count=0;
            int[] arr1=new int[n];
            for (int i = 0; i < n; i++) {
                arr1[i]=sc.nextInt();
                if(arr1[i]==0){
                    count++;
                }
                if(arr1[i]==arr[i]){
                    A++;
                }else{
                    B++;
                }
            }
            if(count==n){
                break;
            }
            System.out.println(A+" "+B);
        }
    }
}
